<?php
session_start(); 
header("Refresh: 12000;");
if($_SESSION['userName'] !='admin'){
header( 'location: ../index.php;' ); 
}
	include("../conf/connect.php");	
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title></title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link rel="stylesheet" type="text/css" href="../style.css" media="screen" />
	<link rel="shortcut icon" href="images/favicon.ico" />
</head>
<body class="iub_back">
	
	<div>Home | HouseHold Info | <a href="adult.php">Adult Info</a> | <a href="test.php">Search</a></div>
	<div> Member information:</div>
	<table align="center" class="table_border" style="width:1024px;background-color:#0099CC;color:#FFFFFF;">
		<tr style="color:#000000;">
	<?php
	$sql ="SELECT * FROM user,raw_data where raw_data.user_id=user.id and raw_data.is_delete=0 ORDER BY raw_data.hid";
	$result=mysql_query($sql);
	$head=mysql_fetch_array($result, MYSQL_ASSOC);
	$i=o;
	$keysq = array_keys($head); 
	/*echo "<pre>";	
	print_r($keysq);*/
	foreach($keysq as $key){
	?>
		
			<td><?php echo $key;?></td>
	<?php
	$i++;
	}?>
		</tr>
		<?php
			$sql ="SELECT * FROM user,raw_data where raw_data.user_id=user.id and raw_data.is_delete=0";
			$result=mysql_query($sql);
			$k=1;
			while($row=mysql_fetch_array($result, MYSQL_ASSOC)){
				if($k%2==0)
					echo "<tr bgcolor='#999999'>";
				else
					echo "<tr bgcolor='#333333'>";
				foreach ($row as $key => $value) {
					//echo "Key: $key; Value: $value<br />\n";
				
		?>
							<td><?php echo $value;?></td>
		<?php   }
				echo "</tr>";
				$k++;
		    }
		?>
			
	</table>
	<div> Elapsed Time:</div>
	<table align="center" class="table_border" style="width:1024px;background-color:#993333;color:#FFFFFF;">
		<tr style="color:#000000;">
	<?php
	$sql ="SELECT * FROM user,elapsed_time where elapsed_time.user_id=user.id and  elapsed_time.is_delete=0";
	$result=mysql_query($sql);
	$head=mysql_fetch_array($result, MYSQL_ASSOC);
	$i=o;
	$keysq = array_keys($head); 
	/*echo "<pre>";	
	print_r($keysq);*/
	foreach($keysq as $key){
	?>
		
			<td><?php echo $key;?></td>
	<?php
	$i++;
	}?>
		</tr>
		<?php
			$sql ="SELECT * FROM user,elapsed_time where elapsed_time.user_id=user.id and  elapsed_time.is_delete=0";
			$result=mysql_query($sql);
			$k=1;
			while($row=mysql_fetch_array($result, MYSQL_ASSOC)){
				if($k%2==0)
					echo "<tr bgcolor='#999999'>";
				else
					echo "<tr bgcolor='#333333'>";
				foreach ($row as $key => $value) {
					//echo "Key: $key; Value: $value<br />\n";
				
		?>
							<td><?php echo $value;?></td>
		<?php   }
				echo "</tr>";
				$k++;
		    }
		?>
			
	</table>
	<div> House Hold information:</div>
	<table align="center" class="table_border" style="width:1024px;background-color:#FFCC66;color:#FFFFFF;">
		<tr style="color:#000000;">
	<?php
	$sql ="SELECT * FROM household_info where  is_delete=0";
	$result=mysql_query($sql);
	$head=mysql_fetch_array($result, MYSQL_ASSOC);
	$i=o;
	$keysq = array_keys($head); 
	/*echo "<pre>";	
	print_r($keysq);*/
	foreach($keysq as $key){
	?>
		
			<td><?php echo $key;?></td>
	<?php
	$i++;
	}?>
		</tr>
		<?php
			$sql ="SELECT * FROM household_info where  is_delete=0";
			$result=mysql_query($sql);
			$k=1;
			while($row=mysql_fetch_array($result, MYSQL_ASSOC)){
				if($k%2==0)
					echo "<tr bgcolor='#999999'>";
				else
					echo "<tr bgcolor='#333333'>";
				foreach ($row as $key => $value) {
					//echo "Key: $key; Value: $value<br />\n";
				
		?>
							<td><?php echo $value;?></td>
		<?php   }
				echo "</tr>";
				$k++;
		    }
		?>
			
	</table>
	
	<div> Assets information:</div>
	<table align="center" class="table_border" style="width:1024px;background-color:#993333;color:#FFFFFF;">
		<tr style="color:#000000;">
	<?php
	$sql ="SELECT * FROM household_asset where  is_delete=0";
	$result=mysql_query($sql);
	$head=mysql_fetch_array($result, MYSQL_ASSOC);
	$i=o;
	$keysq = array_keys($head); 
	/*echo "<pre>";	
	print_r($keysq);*/
	foreach($keysq as $key){
	?>
		
			<td><?php echo $key;?></td>
	<?php
	$i++;
	}?>
		</tr>
		<?php
			$sql ="SELECT * FROM household_asset where  is_delete=0";
			$result=mysql_query($sql);
			$k=1;
			while($row=mysql_fetch_array($result, MYSQL_ASSOC)){
				if($k%2==0)
					echo "<tr bgcolor='#999999'>";
				else
					echo "<tr bgcolor='#333333'>";
				foreach ($row as $key => $value) {
					//echo "Key: $key; Value: $value<br />\n";
				
		?>
							<td><?php echo $value;?></td>
		<?php   }
				echo "</tr>";
				$k++;
		    }
		?>
			
	</table>
	
	<div> Econimic hardship information:</div>
	<table align="center" class="table_border" style="width:1024px;background-color:#993333;color:#FFFFFF;">
		<tr style="color:#000000;">
	<?php
	$sql ="SELECT * FROM household_economic where  is_delete=0";
	$result=mysql_query($sql);
	$head=mysql_fetch_array($result, MYSQL_ASSOC);
	$i=o;
	$keysq = array_keys($head); 
	/*echo "<pre>";	
	print_r($keysq);*/
	foreach($keysq as $key){
	?>
		
			<td><?php echo $key;?></td>
	<?php
	$i++;
	}?>
		</tr>
		<?php
			$sql ="SELECT * FROM household_economic where  is_delete=0";
			$result=mysql_query($sql);
			$k=1;
			while($row=mysql_fetch_array($result, MYSQL_ASSOC)){
				if($k%2==0)
					echo "<tr bgcolor='#999999'>";
				else
					echo "<tr bgcolor='#333333'>";
				foreach ($row as $key => $value) {
					//echo "Key: $key; Value: $value<br />\n";
				
		?>
							<td><?php echo $value;?></td>
		<?php   }
				echo "</tr>";
				$k++;
		    }
		?>
			
	</table>
</body>
</html>